package com.admin.controller;


import com.admin.service.IProvinceService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bean.ResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author marisheng
 * @since 2019-11-21
 */
@RestController
@RequestMapping("/admin/province")
public class ProvinceController {
    @Autowired
    private IProvinceService provinceService;

    /*根据范围的code查出 省
     */
    @RequestMapping("selprovince")
    public ResponseBean selprovince(String Code){
        QueryWrapper q=new QueryWrapper();
        if(Code!=null){
            q.eq("region_id",Code);
        }
        List list= (List) provinceService.list(q);
        return new ResponseBean(0,null,list);
    }

}
